//
//  KDJ.h
//  Chart
//
//  Created by ma xiaoyang on 6/19/13.
//
//

#ifndef __Chart__KDJ__
#define __Chart__KDJ__

#include "IndexData.h"

#include <utility>
#include <string>
#include <vector>

namespace ytx
{
    class KDJ : public IndexData
    {
    public:
        KDJ(IndexConfig indexConfig);
        virtual ~KDJ();
        
        double getRSV(Quotation * data, int index, int n);

        virtual void calculate(Quotation * data);
        
        virtual void updateLastest(Quotation * data);
        
        virtual std::string getCrosshairYData(int index);
        virtual int getDataLength() const;
        virtual bool hasData() const;
        virtual bool hasData(int index) const;
        virtual std::pair<double, double> getAdjustedDataMinMax(int startIndex, int endIndex, const Rectangle & rect) const;
        virtual std::vector<std::pair<double, std::string> > getLeftSideText(int startIndex, int endIndex, const Rectangle & rect, const Style & style) const;
        virtual std::vector<std::pair<std::string, std::string> > getTopSideText(int index) const;
    };
}

#endif /* defined(__Chart__KDJ__) */
